<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../style/ucs.css">
		<link rel="stylesheet" href="../content/font/iconfont.css">
		<link rel="stylesheet" href="../style/theme.css">
	</head>
	<body>
	<div id="giraffe" ></div>
	<script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
	<script type="text/javascript" src="../../dist/libs/engine.js" ></script>
	<script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>
	<script>
		var NoticesDM = new UDM({
			value: []
		});
		//分页条模型
		var paginationDM = new UDM({
			value: {	//默认值为0
				totalPage: 0,	//总页数
				pageSize: 2,	//每页显示条数
				curPage: 1	//当前页码
			},
			onClick:function(){
				ajaxFn();
			}
		});

		//侧边栏
		var sideBarDM = new UDM({
			value:{
				defaultKey: 0,
				sideBarList: [
					{
						itemName: "关于我们",
						itemChildList: [
							{
								childName: "平台介绍",
								childUrl: "../PlatformIntro/index.html",
								current: false
							},
							{
								childName: "安全保障",
								childUrl: "../Insurance/index.html",
								current: false
							},
							{
								childName: "平台公告",
								childUrl: "../PlatformNotice/index.html",
								current: true
							},
							{
								childName: "名词解释",
								childUrl: "../NounExplain/index.html",
								current: false
							},
							{
								childName: "服务协议",
								childUrl: "../ServiceProtocol/index.html",
								current: false
							},
							{
								childName: "免责声明",
								childUrl: "../DisclaimerStat/index.html",
								current: false
							},
							{
								childName: "联系我们",
								childUrl: "../LinkUs/index.html",
								current: false
							}
						]
					},
					{
						itemName: "关于投资",
						itemChildList: [
							{
								childName: "投资操作指引",
								childUrl: "../InvestOperaGuide/index.html",
								current: false
							}
						]
					},
					{
						itemName: "关于融资",
						itemChildList: [
							{
								childName: "融资操作指引",
								childUrl: "../FinanceOperaGuide/index.html",
								current: false
							}
						]
					},
					{
						itemName: "账户管理",
						itemChildList: [
							{
								childName: "注册操作指引",
								childUrl: "../RegOperaGuide/index.html",
								current: false
							},
							{
								childName: "添加银行卡操作指引",
								childUrl: "../AddCardOperaGuide/index.html",
								current: false
							},
							{
								childName: "找回密码操作指引",
								childUrl: "../FindPwdOperaGuide/index.html",
								current: false
							},
							{
								childName: "实名认证指引",
								childUrl: "../RealNameAuthenGuide/index.html",
								current: false
							}
						]
					},
					{
						itemName: "常见问题",
						itemChildList: [
							{
								childName: "常见问题",
								childUrl: "../Faq/index.html",
								current: false
							}
						]
					}
				]
			}
		});

		var PageDM = {
			sideBar: sideBarDM,
			pagination: paginationDM,
			Notices: NoticesDM
		}

		var ajaxFn = function(){
			var pageSize = paginationDM.getValue().pageSize;	//获取每页显示条数
			var curPage = paginationDM.getValue().curPage;		//获取当前选中页码

			var Notices = {
				TotalCount:4,
				Notices: [
					{
						MessageID:"ee43e3dc-76e8-4c75-b0ac-c0faef6aec27",
						LinkUrl:null,
						Title:"愚人节大礼1",
						Description:"愚人节，高收益项目，等你一起high！",
						OpenMode:0,
						PicUrl:"",
						CreateTime:"2016-12-01"
					},
					{
						MessageID:"ee43e3dc-76e8-4c75-b0ac-c0faef6aec27",
						LinkUrl:null,
						Title:"愚人节大礼2",
						Description:"愚人节，高收益项目，等你一起high！",
						OpenMode:0,
						PicUrl:"",
						CreateTime:"2016-12-01"
					},
					{
						MessageID:"ee43e3dc-76e8-4c75-b0ac-c0faef6aec27",
						LinkUrl:null,
						Title:"愚人节大礼3",
						Description:"愚人节，高收益项目，等你一起high！",
						OpenMode:0,
						PicUrl:"",
						CreateTime:"2016-12-01"
					},
					{
						MessageID:"ee43e3dc-76e8-4c75-b0ac-c0faef6aec27",
						LinkUrl:null,
						Title:"愚人节大礼4",
						Description:"愚人节，高收益项目，等你一起high！",
						OpenMode:0,
						PicUrl:"",
						CreateTime:"2016-12-01"
					}
				]
			}
			var paginationValue = {
				totalPage: Math.ceil(Notices.TotalCount/pageSize),	//总页数
				pageSize: pageSize,	//每页显示条数
				curPage: curPage	//当前页码
			}
			var curNoticeList = [];
			if(Notices.TotalCount>0){
				for(var i = curPage*pageSize - pageSize ; i < curPage*pageSize ; i ++){
					curNoticeList.push(Notices.Notices[i]);
				}
			}
			paginationDM.setValue(paginationValue);
			NoticesDM.setValue(curNoticeList);
		};
		UEventHub.on("pageLoad",function(){
			ajaxFn()
		});
	</script>
    </body>
</html>
